<html>
<head>
	<title> System Management & Security </title>
	<link rel="stylesheet" type="text/css" href="css/html.css">
	<link rel="stylesheet" type="text/css" href="css/docbook.css">
	<link rel="stylesheet" type="text/css" href="css/syntax.css">
</head>


<body>
<h1> 4 Manual Pages </h1>

<div class="TOC">
<dl>
	<dt><b>Table of Contents</b></dt>
	<dt>4.1 <a href="chapter4.html#USAGE">   Usage </a></dt>
	<dt>4.2 <a href="chapter4.html#HISTORY"> History </a></dt>
        <dt>4.3 <a href="chapter4.html#SECTIONS">Sections </a></dt>
</dl>
</div>

<p>
Almost all substantial UNIX and Unix-like operating systems have extensive documentation known as man pages (short for "manual pages"). The Unix command used to display them is man. Each page is a self-contained document.
</p>


<!------------------ 4.1 Usage ---------------------------------------->
<div class="SECT1">
<h1 class="SECT1"><a id="USAGE" name="USAGE">4.1 Usage</a></h1>
<p>
For reading a manual page for a Unix command, you can use <kbd class="USERINPUT">  man <b>command_name</b> </kbd> at a shell prompt, e.g. 
</p>
<div class="CODELISTING"> 
  <pre> man <b>printf</b> </pre>
</div>
<p>
Manual pages are located in <tt class="FILENAME">/usr/share/man/</tt>. The pages are traditionally referred to using the notation "name(section)"; for example, printf(1). The same page name may appear in more than one section of the manual, this can occur when the names of system calls, user commands, or macro packages conflict. Two examples are man(1) and man(7), or exit(2) and exit(3). The syntax for accessing the non-default manual section varies between different man implementations. On FreeBSD, for example, the syntax for reading printf(3) is

<div class="CODELISTING">
  <pre> man <b>3 printf</b> </pre>
</div>
</p>
<small>
Reference <a href="http://en.wikipedia.org/wiki/Manual_page_(Unix)#Usage"> http://en.wikipedia.org/wiki/Manual_page_(Unix)#Usage</a>
</small>
</div>


<!------------------ 4.2 History ---------------------------------------->
<div class="SECT2">
<h1 class="SECT2"><a id="HISTORY" name="HISTORY">4.2 History</a></h1>
<p>
The UNIX Programmer's Manual was first published on November 3, 1971. The first actual man pages were written by Dennis Ritchie and Ken Thompson at the insistence of Doug McIlroy in 1971. The troff macros used for man pages (-mm) were the general-purpose ones written by Ted Dolotta (later to be the first manager of USG and the principal author of the System III manual), with additions for the manuals. At the time, the availability of online documentation through the manual page system was regarded as a great advance. To this day, virtually every Unix command line application comes with its man page, and many Unix users perceive a lack of man pages as a sign of low quality; indeed, some projects, such as Debian, go out of their way to write man pages for programs lacking one. Few alternatives to man have enjoyed much popularity, with the possible exception of the GNU project's "info" system, an early and simple hypertext system.
</p>
<small>
Reference <a href="http://en.wikipedia.org/wiki/Manual_page_(Unix)#History">http://en.wikipedia.org/wiki/Manual_page_(Unix)#History</a>
</small>
</div>


<!------------------ 4.3 Sections ---------------------------------------->
<div class="SECT3">
<h1 class="SECT3"><a id="SECTIONS" name="SECTIONS">4.3 Sections</a></h1>
<table>
  <tr>
    <td><b>section</b></td>
    <td><b>meaning</b></td>
  </tr>
  <tr>
    <td> 1 </td>
    <td> Shell commands (tools, utilities) [ls] </td>
  </tr>
  <tr>
    <td> 2 </td>
    <td> System calls (kernel functions) [open] </td>
  </tr>
  <tr>
    <td> 3 </td>
    <td> Library calls (C library functions) [sqrt] </td>
  </tr>
  <tr>
    <td> 4 </td>
    <td> Device Drivers [lp] </td>
  </tr>
  <tr>
    <td> 5 </td>
    <td> File formats [/etc/passwd] </td>
  </tr>
  <tr>
    <td> 6 </td>
    <td> Games </td>
  </tr>
  <tr>
    <td> 7 </td>
    <td> Macro packages and conventions [man, groff] </td>
  </tr>
  <tr>
    <td> 8 </td>
    <td> System administration commands [mount] </td>
  </tr>
  <tr>
    <td> 9 </td>
    <td> (BSD) Kernel internals [suser] </td>
  </tr>
</table>
<p>
Manual pages are searched in the order of the sections. Therefore the default displayed page is the first matched.
</p>
</div>
 

<!------------------ 4.3 Example ---------------------------------------->
<div class="SECT3">
<h1 class="SECT3"><a id="EXAMPLE" name="EXAMPLE">4.3 Example</a></h1>
<p><b>example of the manual page of touch(1)</b></p>
<div class="CODELISTING">
<pre>
TOUCH(1)                                                                User Commands                                                 TOUCH(1)

NAME
       touch - change file timestamps

SYNOPSIS
       touch [OPTION]... FILE...

DESCRIPTION
       Update the access and modification times of each FILE to the current time.

       A FILE argument that does not exist is created empty.

       A FILE argument string of - is handled specially and causes touch to change the times of the file associated with standard output.

       Mandatory arguments to long options are mandatory for short options too.

</pre>
</div>

</div>

</body>
</html>